gtk4.git
4 years agoUse our own loaders for content (de)serialization
Matthias Clasen [Fri, 10 Sep 2021 02:23:37 +0000 (22:23 -0400)]
Use our own loaders for content (de)serialization

Use our own loader to (de)serialiaze textures
to and from png and tiff.

We still fall back to gdk-pixbuf for handling all
the other image formats, and for pixbufs.

4 years agoAdd tests for the jpeg loader
Matthias Clasen [Sun, 12 Sep 2021 03:28:06 +0000 (23:28 -0400)]
Add tests for the jpeg loader

4 years agoLoad jpegs without gdk-pixbuf
Matthias Clasen [Sat, 11 Sep 2021 21:02:41 +0000 (17:02 -0400)]
Load jpegs without gdk-pixbuf

Use our own loader for jpeg files.

4 years agoAdd code to load jpegs
Matthias Clasen [Tue, 14 Sep 2021 11:48:49 +0000 (07:48 -0400)]
Add code to load jpegs

This lets us avoid gdk-pixbuf for loading
textures from the common image formats.

As a consequence, we are now linking against libjpeg.

4 years agoAdd gdk_texture_save_to_tiff
Matthias Clasen [Tue, 7 Sep 2021 13:20:05 +0000 (09:20 -0400)]
Add gdk_texture_save_to_tiff

This is a companion to gdk_texture_save_to_png, using
the tiff format, which will let us avoid lossy conversion
of HDR data, since we can store floating point data.

4 years agoAdd tests for the tiff loader
Matthias Clasen [Sun, 12 Sep 2021 05:07:16 +0000 (01:07 -0400)]
Add tests for the tiff loader

4 years agoLoad tiffs without gdk-pixbuf
Matthias Clasen [Sat, 11 Sep 2021 20:30:37 +0000 (16:30 -0400)]
Load tiffs without gdk-pixbuf

This will let us load floating point data, in
the future.

4 years agoAdd code to load and save tiff files
Matthias Clasen [Fri, 10 Sep 2021 16:47:14 +0000 (12:47 -0400)]
Add code to load and save tiff files

Add support for the tiff format, which is flexible
enough to handle all our memory texture formats
without loss.

As a consequence, we are now linking against libtiff.

4 years agoAdd gdk_texture_save_to_png_bytes
Matthias Clasen [Mon, 13 Sep 2021 18:29:31 +0000 (14:29 -0400)]
Add gdk_texture_save_to_png_bytes

Just expose what we already have available
internally, so e.g. tests can use it without
static linking.

4 years agoAdd tests for the png loader
Matthias Clasen [Sun, 12 Sep 2021 00:27:13 +0000 (20:27 -0400)]
Add tests for the png loader

4 years agoSave pngs without cairo
Matthias Clasen [Sun, 12 Sep 2021 13:24:59 +0000 (09:24 -0400)]
Save pngs without cairo

Use our own loader for pngs, which will allow
us to save e.g. 16-bit data in the future.

4 years agoLoad pngs without gdk-pixbuf
Matthias Clasen [Sat, 11 Sep 2021 20:23:53 +0000 (16:23 -0400)]
Load pngs without gdk-pixbuf

Use our own loader for pngs, which will allow
us to get e.g. 16-bit data in the future.

4 years agoAdd code to load and save pngs
Matthias Clasen [Fri, 10 Sep 2021 16:44:43 +0000 (12:44 -0400)]
Add code to load and save pngs

Using libpng instead of the lowest-common-denominator
gdk-pixbuf loader. This will allow us to load >8bit data,
and apply gamma and color correction in the future.
For now, this still just provides RGBA8 data.

As a consequence, we are now linking against libpng.

4 years agotexture: Add error enum
Matthias Clasen [Tue, 14 Sep 2021 00:51:42 +0000 (20:51 -0400)]
texture: Add error enum

4 years agoMerge branch 'modern-testsuite' into 'master'
Benjamin Otte [Thu, 16 Sep 2021 22:22:56 +0000 (22:22 +0000)]
Merge branch 'modern-testsuite' into 'master'

testsuite: modernize image handling

Closes #4261

See merge request GNOME/gtk!3955

4 years agoreftests: Use the default (aka NGL) renderer
Benjamin Otte [Wed, 15 Sep 2021 14:47:09 +0000 (16:47 +0200)]
reftests: Use the default (aka NGL) renderer

All tests pass with the renderer now, so we can remove useof the
fallback.

4 years agoreftests: XFAIL border-half-pixel test
Benjamin Otte [Thu, 16 Sep 2021 18:41:25 +0000 (20:41 +0200)]
reftests: XFAIL border-half-pixel test

the GL renderer can't deal with non-integers

4 years agoreftests: Use colors without rounding errors
Benjamin Otte [Thu, 16 Sep 2021 18:26:26 +0000 (20:26 +0200)]
reftests: Use colors without rounding errors

Color values must be divisible by 15 to be convertible into U8 and U16
values with the same result. 0x80 is not one of these values, so switch
it to 0x99.

4 years agorendernodeparser: Handle is_color attribute for glyphs
Benjamin Otte [Thu, 16 Sep 2021 05:39:21 +0000 (07:39 +0200)]
rendernodeparser: Handle is_color attribute for glyphs

4 years agongl: Avoid offscreens in more cases
Matthias Clasen [Thu, 16 Sep 2021 12:05:21 +0000 (08:05 -0400)]
ngl: Avoid offscreens in more cases

We avoid an offscreen if we know the child node
can 'handle' the transform. Shadow nodes can if their
child node does - either the child node is a text node
in which case the shortcuts we take for shadow nodes
will work fine with the transform (we just render the
text node offset), or the child is not a text node,
in which case we render the shadow to an offscreen
anyway.

This change makes the label-shadows reftest pass with
the GL renderer, not by fixing the issue but by avoiding
it.

4 years agongl: Improve shortcuts for shadow nodes
Matthias Clasen [Thu, 16 Sep 2021 12:04:09 +0000 (08:04 -0400)]
ngl: Improve shortcuts for shadow nodes

For shadow nodes, we try pretty hard to avoid
rendering shadows, and and we have a shortcut
that just renders text offset, but we can try
harder to do nothing - if the text is offset
by zero, we don't need to draw it at all.

4 years agongl Fix bottom-right border render failure
Benjamin Otte [Thu, 16 Sep 2021 00:28:56 +0000 (02:28 +0200)]
ngl Fix bottom-right border render failure

The wrong index was used for offsetting the bottom border rect.

Test included.

4 years agotestsuite: Switch color from khaki to yellow
Benjamin Otte [Wed, 15 Sep 2021 21:32:22 +0000 (23:32 +0200)]
testsuite: Switch color from khaki to yellow

llvmpipe doesn't loike compositing semitransparent khaki onto solid
khaki without rounding errors.

4 years agoreftests: Make image-compare use textures
Benjamin Otte [Wed, 15 Sep 2021 20:54:14 +0000 (22:54 +0200)]
reftests: Make image-compare use textures

All image comparisons are done on textures now.

4 years agoreftests: Use 0.6 instead of 0.5 for alpha
Benjamin Otte [Wed, 15 Sep 2021 20:37:56 +0000 (22:37 +0200)]
reftests: Use 0.6 instead of 0.5 for alpha

See previous commit about rounding

4 years agoreftests: Use 0.6 alpha, not 0.5
Benjamin Otte [Wed, 15 Sep 2021 20:32:12 +0000 (22:32 +0200)]
reftests: Use 0.6 alpha, not 0.5

0.5 leads to some GL renderers computing 0.5 * 0xFF as 0x7F and
others 0x80, while 0.6 * 0xFF (255 is divisible by 5) is always 0x99.

4 years agotestsuite: Port compare_render() to use textures
Benjamin Otte [Wed, 15 Sep 2021 20:13:57 +0000 (22:13 +0200)]
testsuite: Port compare_render() to use textures

4 years agotests: Update rendernode test to use textures
Benjamin Otte [Wed, 15 Sep 2021 15:21:24 +0000 (17:21 +0200)]
tests: Update rendernode test to use textures

4 years agotestuite: Add opacity-overdraw test
Benjamin Otte [Wed, 15 Sep 2021 05:37:57 +0000 (07:37 +0200)]
testuite: Add opacity-overdraw test

Tests that overdrawing of content inside an opacity node happens before
the opacity is applied.

This is broken in the GL renderer and causes the opacity.ui reftest to
fail.

4 years agongl: Fix opacity handling
Matthias Clasen [Wed, 15 Sep 2021 12:26:54 +0000 (08:26 -0400)]
ngl: Fix opacity handling

We need to use an offscreen whenever there is overlapping
children somewhere in the tree below, just checking the
direct child of the opacity node is not enough.

Fixes: #4261
4 years agoreftests: Use GdkTexture instead of cairo_surface_t
Benjamin Otte [Wed, 15 Sep 2021 04:55:25 +0000 (06:55 +0200)]
reftests: Use GdkTexture instead of cairo_surface_t

This also switches the rendering code from using gsk_render_node_draw()
to gsk_renderer_render_texture().

Some tests are broken with the GL renderer, so this patch forces the
Cairo renderer until they get fixed.

4 years agoreftests: Make diff pixels always opaque
Benjamin Otte [Wed, 15 Sep 2021 14:39:09 +0000 (16:39 +0200)]
reftests: Make diff pixels always opaque

We had pixels that did not differ in alpha and we then set 0 alpha
difference hich made the pixel invisible. Oops.

4 years agotestsuite: remove box-order test
Benjamin Otte [Wed, 15 Sep 2021 04:53:15 +0000 (06:53 +0200)]
testsuite: remove box-order test

The test used to test that GtkBox ordered it's children left-to-right in
CSS, no matter the text direction or pack-type.

But there is neither a pack-type anymore nor does GTK4 do that.

So that test has been broken for yers, it just didn't render anything
wrong.

4 years agoAPI: Add gdk_texture_new_from_filename()
Benjamin Otte [Wed, 15 Sep 2021 20:08:33 +0000 (22:08 +0200)]
API: Add gdk_texture_new_from_filename()

There are quite a few places where we can make use of it, in particular
in the testsuite and icontheme.

4 years agotestsuite: Fix race in texture-threads test
Benjamin Otte [Thu, 16 Sep 2021 21:56:41 +0000 (23:56 +0200)]
testsuite: Fix race in texture-threads test

Threads are evil, yo.

4 years agogltexture: Fallback in download_float()
Benjamin Otte [Thu, 16 Sep 2021 21:30:37 +0000 (23:30 +0200)]
gltexture: Fallback in download_float()

GLES only allows downloading float if the texture matches specific
criteria and I'm too lazy to determine them, so always fall back.

And the custom stride fallback code isn't necessary, because falling
back does exactly that step already.

4 years agogltexture: Fix download() for GLES
Benjamin Otte [Thu, 16 Sep 2021 21:14:59 +0000 (23:14 +0200)]
gltexture: Fix download() for GLES

GLES can't do glGetTexImage(), so implement a version that does
glReadPixels() on GLES.

4 years agotestsuite: Be more verbose in texture-threads test
Benjamin Otte [Thu, 16 Sep 2021 19:49:50 +0000 (21:49 +0200)]
testsuite: Be more verbose in texture-threads test

The test randomly fails on CI, so try to be more helpful in debugging
them.

4 years agoMerge branch 'master' into 'master'
Matthias Clasen [Thu, 16 Sep 2021 18:32:23 +0000 (18:32 +0000)]
Merge branch 'master' into 'master'

Do not require wayland-protocols as dependency in the .pc files

See merge request GNOME/gtk!3960

4 years agoDo not require wayland-protocols as dependency in the .pc file
muradm [Thu, 16 Sep 2021 14:53:00 +0000 (17:53 +0300)]
Do not require wayland-protocols as dependency in the .pc file

Basically, I was building some packages on Guix. I figured out that
wayland-protocols was listed among propagated-inputs for gtk+ package
(gtk-3-24). propagated-inputs holds a list of runtime dependencies,
that should be available to any other package that depends on gtk+.
While discussing we clarified that wayland-protocols is not runtime
dependency. So I moved it to native-inputs of gtk+ package, which
means that, this dependency will be available only to gtk+ package and
only at build time. Once moved, building of other applications that
depening on gtk+ started to fail.

Investigation showed that, all .pc (pkg-config) files prepared by gtk+
package, was including:

Requires.private: ... wayland-protocols ...

Since it becomes requirement, other applications was failing with
missing dependency wayland-protocols of dependency gtk+, for instance:

-- Checking for module 'gtk+-3.0'
--   Package 'wayland-protocols', required by 'gdk-3.0', not found

While actually wayland-protocols is not even a build time dependency
of application that depends on gtk+. Advertisement of such
requirement, is a bit misleading, because one does not need it at
runtime, especially applications based on gtk.

4 years agoMerge branch 'wip/jimmac/make-toolbar-togglebuttons-visible' into 'master'
Matthias Clasen [Thu, 16 Sep 2021 11:35:35 +0000 (11:35 +0000)]
Merge branch 'wip/jimmac/make-toolbar-togglebuttons-visible' into 'master'

theme: make toggled tbuttons in toolbars visible

Closes #4264

See merge request GNOME/gtk!3959

4 years agotheme: make toggled tbuttons in toolbars visible
Jakub Steiner [Thu, 16 Sep 2021 10:47:26 +0000 (12:47 +0200)]
theme: make toggled tbuttons in toolbars visible

- do what Alex does in libadwaita

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/4264

4 years agoMerge branch 'misc-texture-things' into 'master'
Matthias Clasen [Thu, 16 Sep 2021 03:14:12 +0000 (03:14 +0000)]
Merge branch 'misc-texture-things' into 'master'

Add gdk_texture_new_from_bytes

See merge request GNOME/gtk!3958

4 years agopixbufutils: Simplify function
Benjamin Otte [Tue, 14 Sep 2021 16:17:44 +0000 (18:17 +0200)]
pixbufutils: Simplify function

4 years agotexture: Mention download_float in the docs
Matthias Clasen [Tue, 14 Sep 2021 12:38:25 +0000 (08:38 -0400)]
texture: Mention download_float in the docs

4 years agoAdd gdk_texture_new_from_bytes
Matthias Clasen [Mon, 13 Sep 2021 17:30:12 +0000 (13:30 -0400)]
Add gdk_texture_new_from_bytes

Add this new api, and make gdk_texture_new_from_file
a wrapper around it.

4 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Thu, 16 Sep 2021 01:56:39 +0000 (01:56 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

Fix memorytexture float conversion

See merge request GNOME/gtk!3957

4 years agongl: Avoid cairo_to_png in debug output
Matthias Clasen [Tue, 14 Sep 2021 21:59:26 +0000 (17:59 -0400)]
ngl: Avoid cairo_to_png in debug output

Just use a GL texture and gdk_texture_save_to_png,
it was made for this.

4 years agoFix memorytexture float conversion
Matthias Clasen [Wed, 15 Sep 2021 04:27:32 +0000 (00:27 -0400)]
Fix memorytexture float conversion

This was silently dropping the alpha in one case.

4 years agoMerge branch 'update-readme' into 'master'
Matthias Clasen [Wed, 15 Sep 2021 23:25:57 +0000 (23:25 +0000)]
Merge branch 'update-readme' into 'master'

Update the README

See merge request GNOME/gtk!3956

4 years agoApply 1 suggestion(s) to 1 file(s)
Matthias Clasen [Wed, 15 Sep 2021 21:50:36 +0000 (21:50 +0000)]
Apply 1 suggestion(s) to 1 file(s)

4 years agoUpdate the README
Matthias Clasen [Wed, 15 Sep 2021 19:08:13 +0000 (15:08 -0400)]
Update the README

Remove the mention of GNU (since that has not been case
for a long time, effectively), state that GTK is hosted
by the GNOME project, and point to GNOME as a place
for donations.

4 years agoUpdate Chinese (China) translation
Boyuan Yang [Wed, 15 Sep 2021 18:41:06 +0000 (18:41 +0000)]
Update Chinese (China) translation

4 years agoUpdate Chinese (China) translation
Dz Chen [Wed, 15 Sep 2021 15:28:39 +0000 (15:28 +0000)]
Update Chinese (China) translation

4 years agoMerge branch 'function-annotations' into 'master'
Matthias Clasen [Tue, 14 Sep 2021 21:39:48 +0000 (21:39 +0000)]
Merge branch 'function-annotations' into 'master'

Annotate gsk_rounded_rect_is_circular as pure

See merge request GNOME/gtk!3952

4 years agoAnnotate gtk_get_default_language as const
Matthias Clasen [Tue, 14 Sep 2021 17:14:44 +0000 (13:14 -0400)]
Annotate gtk_get_default_language as const

4 years agoAnnotate gtk_editable_get_chars as malloc
Matthias Clasen [Tue, 14 Sep 2021 17:14:31 +0000 (13:14 -0400)]
Annotate gtk_editable_get_chars as malloc

4 years agocsstypes: Add annotations and inlines
Matthias Clasen [Tue, 14 Sep 2021 17:13:18 +0000 (13:13 -0400)]
csstypes: Add annotations and inlines

Inline _gtk_css_change_for_sibling and
_gtk_css_change_for_child, and mark a few
other functions as const or malloc.

4 years agoAnnotate some builder apis as malloc
Matthias Clasen [Tue, 14 Sep 2021 17:12:54 +0000 (13:12 -0400)]
Annotate some builder apis as malloc

4 years agoAnnotate gtk_accelerator_get_default_mod_mask as const
Matthias Clasen [Tue, 14 Sep 2021 17:12:41 +0000 (13:12 -0400)]
Annotate gtk_accelerator_get_default_mod_mask as const

4 years agoAnnotate gsk_cairo_blur_compute_pixels as const
Matthias Clasen [Tue, 14 Sep 2021 17:11:42 +0000 (13:11 -0400)]
Annotate gsk_cairo_blur_compute_pixels as const

4 years agoAnnotate gdk_rgba_to_string as malloc
Matthias Clasen [Tue, 14 Sep 2021 17:11:20 +0000 (13:11 -0400)]
Annotate gdk_rgba_to_string as malloc

4 years agoAnnotate gdk_drag_action_is_unique as const
Matthias Clasen [Tue, 14 Sep 2021 17:10:48 +0000 (13:10 -0400)]
Annotate gdk_drag_action_is_unique as const

4 years agoAnnotate gtk_css_tokenizer_get_location as const
Matthias Clasen [Tue, 14 Sep 2021 16:23:37 +0000 (12:23 -0400)]
Annotate gtk_css_tokenizer_get_location as const

4 years agocssparser: Mark some functions as pure and malloc
Matthias Clasen [Tue, 14 Sep 2021 16:23:07 +0000 (12:23 -0400)]
cssparser: Mark some functions as pure and malloc

4 years agoAnnotate gsk_ngl_uniform_state_align as pure
Matthias Clasen [Tue, 14 Sep 2021 16:22:36 +0000 (12:22 -0400)]
Annotate gsk_ngl_uniform_state_align as pure

4 years agoAnnotate gsk_rounded_rect_is_circular as pure
Matthias Clasen [Tue, 14 Sep 2021 16:21:34 +0000 (12:21 -0400)]
Annotate gsk_rounded_rect_is_circular as pure

And also mark gsk_rounded_rect_to_string as malloc.

4 years agoAnnotate pango_glyph_string_num_glyphs as pure
Matthias Clasen [Tue, 14 Sep 2021 16:21:05 +0000 (12:21 -0400)]
Annotate pango_glyph_string_num_glyphs as pure

4 years agoAnnotate gdk_unichar_direction as const
Matthias Clasen [Tue, 14 Sep 2021 16:19:13 +0000 (12:19 -0400)]
Annotate gdk_unichar_direction as const

4 years agoMerge branch 'gsk-tests-gl' into 'master'
Matthias Clasen [Tue, 14 Sep 2021 20:37:16 +0000 (20:37 +0000)]
Merge branch 'gsk-tests-gl' into 'master'

testsuite: Call g_test_init in test binaries

See merge request GNOME/gtk!3953

4 years agotestsuite: Stop running tests for the gl renderer
Matthias Clasen [Tue, 14 Sep 2021 20:11:42 +0000 (16:11 -0400)]
testsuite: Stop running tests for the gl renderer

It does not exist anymore.

4 years agotestsuite: Call g_test_init in test binaries
Matthias Clasen [Tue, 14 Sep 2021 20:10:39 +0000 (16:10 -0400)]
testsuite: Call g_test_init in test binaries

Without it, we mess out on G_DEBUG=fatal-warnings,
so our ci does not alert us that we run a bunch of
tests which spit out warnings.

4 years agoMerge branch 'fix_accessible_described_by' into 'master'
Matthias Clasen [Tue, 14 Sep 2021 13:29:28 +0000 (13:29 +0000)]
Merge branch 'fix_accessible_described_by' into 'master'

Fix generation of accessible description in presence of described by relations

See merge request GNOME/gtk!3948

4 years agoMerge branch 'test-leak-fixes' into 'master'
Matthias Clasen [Tue, 14 Sep 2021 13:14:10 +0000 (13:14 +0000)]
Merge branch 'test-leak-fixes' into 'master'

testsuite: Fix a few memory leaks

See merge request GNOME/gtk!3947

4 years agoFix generation of accessible description in presence of described by relations
Lukáš Tyrychtr [Tue, 14 Sep 2021 12:33:30 +0000 (14:33 +0200)]
Fix generation of accessible description in presence of described by relations

The loop going through the relation list should have stopped on the NULL sentinel value, however it never accesed the next list element.

4 years agotestsuite: Fix a few memory leaks
Matthias Clasen [Tue, 14 Sep 2021 12:24:36 +0000 (08:24 -0400)]
testsuite: Fix a few memory leaks

These are keeping the asan build in ci from passing.

4 years agoMerge branch 'tiff-ci' into 'master'
Matthias Clasen [Tue, 14 Sep 2021 12:27:39 +0000 (12:27 +0000)]
Merge branch 'tiff-ci' into 'master'

ci: Add libtiff-devel to the image

See merge request GNOME/gtk!3946

4 years agoci: Use the v4 image
Matthias Clasen [Tue, 14 Sep 2021 12:05:09 +0000 (08:05 -0400)]
ci: Use the v4 image

4 years agoci: Add libtiff-devel to the image
Matthias Clasen [Tue, 14 Sep 2021 12:03:41 +0000 (08:03 -0400)]
ci: Add libtiff-devel to the image

We want to require libtiff in our build.

4 years agoMerge branch 'wip/exalm/papercuts' into 'master'
Matthias Clasen [Tue, 14 Sep 2021 11:36:25 +0000 (11:36 +0000)]
Merge branch 'wip/exalm/papercuts' into 'master'

Fix 2 papercuts

See merge request GNOME/gtk!3945

4 years agomedia-controls: Make play button flat
Alexander Mikhaylenko [Tue, 14 Sep 2021 07:23:03 +0000 (12:23 +0500)]
media-controls: Make play button flat

Match the volume button.

4 years agosearchbar: Vertically center the close button
Alexander Mikhaylenko [Tue, 14 Sep 2021 07:22:45 +0000 (12:22 +0500)]
searchbar: Vertically center the close button

4 years agoMerge branch 'fix_#4255' into 'master'
Matthias Clasen [Mon, 13 Sep 2021 16:10:37 +0000 (16:10 +0000)]
Merge branch 'fix_#4255' into 'master'

stack: Dispose children before emitting items-changed

Closes #4255

See merge request GNOME/gtk!3943

4 years agostack: Dispose children before emitting items-changed
Julian Sparber [Mon, 13 Sep 2021 14:29:30 +0000 (16:29 +0200)]
stack: Dispose children before emitting items-changed

This makes sure that the `GListModel` returned by
`gtk_stack_get_pages()` actually has the items removed before
`items-changed` is emitted.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4255
4 years agoMerge branch 'wip/otte/texture-threads' into 'master'
Benjamin Otte [Mon, 13 Sep 2021 00:16:30 +0000 (00:16 +0000)]
Merge branch 'wip/otte/texture-threads' into 'master'

gltexture: Make sure downloading textures works in a different thread

See merge request GNOME/gtk!3942

4 years agongl: Simplify and unbug texture download
Benjamin Otte [Sun, 12 Sep 2021 23:49:56 +0000 (01:49 +0200)]
ngl: Simplify and unbug texture download

If we can't handle the texture, always just download_texture() it,
that way we are sure it's a memory texture.

4 years agogltexture: Make sure downloading textures works in a different thread
Benjamin Otte [Sun, 12 Sep 2021 22:19:35 +0000 (00:19 +0200)]
gltexture: Make sure downloading textures works in a different thread

This happens in the real world when using the inspector to look at a
node recording of a GStreamer video while the video is still playing.

GStreamer will use the GL context in a different thread while we are
busy trying to download it.

A test is included.

4 years agoUpdate German translation
Philipp Kiemle [Sun, 12 Sep 2021 21:45:26 +0000 (21:45 +0000)]
Update German translation

(cherry picked from commit 17d828fda2137eaa068de947171214db8ec7b074)

4 years agoMerge branch 'wip/otte/float-textures' into 'master'
Benjamin Otte [Sun, 12 Sep 2021 12:55:00 +0000 (12:55 +0000)]
Merge branch 'wip/otte/float-textures' into 'master'

Add float texture formats

See merge request GNOME/gtk!3940

4 years agoUpdate Hungarian translation
Balázs Úr [Sun, 12 Sep 2021 06:03:58 +0000 (06:03 +0000)]
Update Hungarian translation

4 years agotestsuite: Add tests for gdk_texture_download_float()
Benjamin Otte [Sun, 12 Sep 2021 02:34:42 +0000 (04:34 +0200)]
testsuite: Add tests for gdk_texture_download_float()

4 years agotestsuite: Add memory test support for OpenGL up/downloads
Benjamin Otte [Sat, 11 Sep 2021 22:11:44 +0000 (00:11 +0200)]
testsuite: Add memory test support for OpenGL up/downloads

Use a GL renderer to upload textures (and then optionally download them
via release() again). This way, we can test that the GL renderer
properly uploads textures to the right formats (not losing information
for HDR for example) and downloads them again.

4 years agotestsuite: Add tests uploading the memorytextures
Benjamin Otte [Sat, 11 Sep 2021 20:50:09 +0000 (22:50 +0200)]
testsuite: Add tests uploading the memorytextures

Use a GL renderer and render_texture() them.

4 years agotestsuite: Rework memorytexture test some more
Benjamin Otte [Sat, 11 Sep 2021 20:26:37 +0000 (22:26 +0200)]
testsuite: Rework memorytexture test some more

Instead of predefined colors, generate them randomly.

4 years agotestsuite: Overhaul memorytexture test
Benjamin Otte [Sat, 11 Sep 2021 19:19:48 +0000 (21:19 +0200)]
testsuite: Overhaul memorytexture test

Instead of hardcoding pixel values, allow construction of textures by
filling them with GdkRGBA values.

4 years agogl: Implement uploading and downloading HDR formats
Benjamin Otte [Sun, 12 Sep 2021 03:04:32 +0000 (05:04 +0200)]
gl: Implement uploading and downloading HDR formats

Also refactor the GL uploading so it does the fallback in a
GLES-compatible way, which means we only need one fallback.

4 years agomemorytexture: Add support for HDR formats
Benjamin Otte [Sat, 11 Sep 2021 19:18:56 +0000 (21:18 +0200)]
memorytexture: Add support for HDR formats

Also sanitize the input bytes so the strides match alignment
requirements of the data types.

4 years agotexture: Add gdk_texture_download_float()
Benjamin Otte [Fri, 10 Sep 2021 00:40:21 +0000 (02:40 +0200)]
texture: Add gdk_texture_download_float()

4 years agogdk: Deprecate gdk_cairo_draw_from_gl()
Benjamin Otte [Sat, 11 Sep 2021 22:10:10 +0000 (00:10 +0200)]
gdk: Deprecate gdk_cairo_draw_from_gl()

It's broken with various pixel formats and OpenGL ES, it's hard to
understand what everything does, and gdk_texture_download() can be used
instead.

4 years agogltexture: Implement download() via glGetTexImage()
Benjamin Otte [Sat, 11 Sep 2021 22:14:19 +0000 (00:14 +0200)]
gltexture: Implement download() via glGetTexImage()

1. The download via gdk_cairo_draw_from_gl() was broken sometimes

2. We get easy conversion on fallback by chaining up and using
   download_texture().

3. One more place where Cairo is no longer necessary.